<template>
	<view class="container">
		<view class="one_list" v-for="(item,index) in articleData" :key="index" @click="gotoPage(item.id)">
		
			<view class="title_line">

				<view class="title">{{item.title}}</view>
				<view class="none">
					<image src="/static/my/more.png" class="more"></image>
				</view>
			</view>
			
		</view>
		
		<view v-if="is_null">
			<view class="no_data">
				<image src="/static/no_record.png" mode="widthFix" class="image"></image>
				<view >{{$t('no_data')}}</view>
			</view>
		</view>
		<view style="height: 50rpx;"></view>
	</view>
</template>

<script>
import {getArticleList,getArticleDetail } from '@/api/article.js'
export default {
	data() {
	  return {
		 article_id:0,
		 articleData:[],
		 is_null:false
	  }
	},
	onShow() {
		this.getArticleFunc();
	},
	methods:{
		getArticleFunc(){
			getArticleList().then(res=>{
				if(res.code == 0){
					this.articleData = res.data;
					this.is_null = false;
				}else{
					this.articleData = [];
					this.is_null = true;
				}
			})
		},
		gotoPage(id){
			uni.navigateTo({
				url:"/pages/article/detail?id="+id
			})
		}
	}
}
</script>

<style>
	page{
	  background: #fff;
	  /* background: #e1e1e1; */
	}
	.container{
		padding: 36rpx 28rpx;
	}
	.one_list{
		margin-bottom: 22rpx;
	}
	.time_line{
		color: #fff;
		font-size: 28rpx;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
	}
	.dian{
		width: 24rpx;
		height: 24rpx;
		margin-right: 16rpx;
		background-color: #e5a836;
		border-radius: 50%;
		display: inline-block;
	}
	.title_line{
		display: flex;
		border-bottom: 2rpx solid #e3e3e3;
		align-items: center;
	}
	.none{
		width: 40rpx;
	}
	.title{
		flex: 1;
		padding: 20rpx 0rpx;
		border-radius: 12rpx;
		font-size: 28rpx;
		color: #000;
	}
	.no_data{
		display: flex;
		flex-direction: column;
		justify-content: center;
		text-align: center;
		font-size: 24rpx;
		color: #000;
		margin-top: 30%;
	}
	.no_data .image{
		width: 240rpx;
		height: auto;
		margin: auto;
	}
	.more{
		height: 28rpx;
		width: 28rpx;
	}
</style>